package com.foreveredu.propms.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Description:<br/>
 * 领域模型：子账户类，一个账户，包含多个子账户，分别用于预存不同类型的物业费用<br/>
 * Date:<br/>
 * 2013/8/26<br/>
 * 
 * @author hushigang
 */

@Entity
@Table(name = "T_SubAccount")
public class SubAccount {

	private int id;// 子账户编号
	private Account account;// 所属账户
	private int type;// 1代表物业服务费，2代表装修保证金，3代表装修服务费，4代表装修垃圾清运费，5代表预存金额
	private float balance;// 子账户余额

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name = "account_id")
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@Column
	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Column
	public float getBalance() {
		return balance;
	}

	public void setBalance(float balance) {
		this.balance = balance;
	}

}
